Learn R Programming

CompositionalSR (version 1.0)

Spatial k-folds: Spatial k-folds

Description

Spatial k-folds.

Usage

spat.folds(coords, nfolds = 10)

Value

A list with nfolds elements. Each elements contains a list with two elements, the first is the indices of the training set and the second contains the indices of the test set.

Arguments

coords

A matrix with the coordinates of the locations. The first column is the latitude and the second is the longitude.

nfolds

The number of spatial folds to create.

Author

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

Details

Folds of data are created based on their coordinates. For more information see the package blockCV.

See Also

cv.alfaslx, me.aslx, gwar, alfa.reg

Examples

Run this code
data(fadn)
coords <- fadn[, 1:2]
folds <- spat.folds(coords, nfolds = 10)

Run the code above in your browser using DataLab